package codingforgreat.lchot150;

public class Lc045 {
    public int jump(int[] nums) {
        int cur = 0;
        int next = 0;
        int step = 0;
        for(int i = 0;i < nums.length;i++){
            if(i > cur){
                step++;
                cur = next;
            }
            next = Math.max(next,i + nums[i]);
        }
        return step;
    }
}
